package com.qtt.app.mapper;

import com.qtt.app.entity.AppViewsRecord;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AppViewsRecordMapper {
    int deleteByPrimaryKey(Integer viewsRecordId);

    int insert(AppViewsRecord record);

    int insertSelective(AppViewsRecord record);

    AppViewsRecord selectByPrimaryKey(Integer viewsRecordId);

    int updateByPrimaryKeySelective(AppViewsRecord record);

    int updateByPrimaryKey(AppViewsRecord record);

    List<AppViewsRecord> getMyViewsRecordAll(Long userId);

    @Select("SELECT views_record_id FROM app_views_record ORDER BY views_record_id DESC LIMIT 1")
    int getLastId();

    @Delete("DELETE FROM app_views_record WHERE gmt_create <= #{time}")
    int deleteSchedule(String time);
}